package com.csht.mapper;

import java.util.List;
import java.util.Map;

import com.csht.model.CshtMessage;
import com.csht.vo.my.CshtMessageVo;
import com.csht.vo.my.MessageAndUserVo;

public interface CshtMessageMapper {
	
	/**
	 * 根据登录的用户id（被留言者）查询留言
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public List<CshtMessageVo> getMessageByUserId(Map<String, Integer> res) throws Exception;
	
	/**
	 * 根据用户id（被留言者）查询留言总数
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public Integer getMessageNumberByUserId(Integer userId) throws Exception;
	
	/**
	 * 根据留言id查询留言
	 * @param messageId
	 * @return
	 * @throws Exception
	 */
	public CshtMessageVo getMessageByMessageId(Integer messageId) throws Exception;
	
	/**
	 * 根据登录的用户id（留言者）查询留言
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public List<CshtMessageVo> getMessageByMUserId(Map<String, Integer> res) throws Exception;
	
	/**
	 * 根据用户id查询（留言者）留言总数
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public Integer getMessageNumberByMUserId(Integer userId) throws Exception;
	
	/**
	 * 根据留言id查询留言
	 * @param messageId
	 * @return
	 * @throws Exception
	 */
	public CshtMessageVo getMessageByMessageId_2(Integer messageId) throws Exception;
	
	
	/**
	 * 根据商品id查询留言
	 * @param goodsId
	 * @return
	 * @throws Exception
	 */
	public MessageAndUserVo getMessageByGoodsId(Integer goodsId) throws Exception;
	
	/**
	 * 添加留言
	 * @param cshtMessage
	 * @throws Exception
	 */
	public void insertMessage(CshtMessage cshtMessage) throws Exception;
    
}